﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using HotelMgr.Models;
using System.Data;
using System.Data.Entity;

namespace HotelMgr.Controllers
{
    public class HotelController : Controller
    {
        private HotelEntities db = new HotelEntities();
        //
        // GET: /Hotel/

        public ActionResult Index()
        {
            var RoomTypes = db.RoomTypes.ToList();
            return View(RoomTypes);
        }

        //
        //GET;/Hotel/Browse
        public ActionResult Browse(int id)
        {
            var RoomTypeModel = db.RoomTypes.Include(t => t.Rooms).Single(g => g.RoomTypeID == id);
            return View(RoomTypeModel);
        }
        //
        //GET;/Hotel/Details
        public ActionResult Details(int id)
        {
            var room = db.Rooms.Find(id);
            return View(room);
        }

    }
}
